Hệ thống bổ nhiệm bác sĩ trong PHP bằng mã nguồn
1 <?php if(!isset($_SESSION)){
2 session_start();
3 }
4 ?>
5
6 <?php include('header.php'); ?>
7
8
9
10
11 <!-- this is for donor registraton -->
12 <div class="recipient_reg" style="background-color:#272327;">
13 <h3 class="text-center" style="background-color:#272327;color: #fff;">Add Doctor</h3>
14
15 <div class="formstyle" style="float: right;padding:25px;border: 1px solid lightgrey;margin-right:320px; margin-bottom:30px;background-color: #101011;color:#d4530d;;">
16 <form enctype="multipart/form-data" method="post" class="text-center" style="margin-left: 110px">
17 <div class="col-md-12">
18
19 <label>
20 <input type="text" name="doctor_id" value="" placeholder="doctor_id" required>
21 </label><br><br>
22 <label>
23 <input type="text" name="name" value="" placeholder="Full name" required>
24 </label><br><br>
25 <label>
26 <input type="text" name="address" value="" placeholder="address" required>
27 </label><br><br>
28 <label>
29 <input type="text" name="contact" value="" placeholder="contact" required>
30 </label><br><br>
31
32 <label>
33 <input type="email" name="email" value="" placeholder="email" required>
34 </label><br><br>
35
36 <label>
37 <select name="expertise" required>
38 <option>-Expert in-</option>
39 <option>Medicine</option>
40 <option>Heart</option>
41 <option>Bone</option>
42 <<option>kedney</option>
43 <option>Cardiologist</option>
44 <option>Plastic Surgeon</option>
45 <option>General Physician</option>
46 <option>Neurologist</option>
47 </select>
48 </label><br><br>
49 <label>
50 <input type="text" name="id" value="" placeholder="id" required>
51 </label><br><br>
52 <label>
53 <input type="text" name="fee" value="" placeholder="Fee" required>
54 </label><br><br>
55
56
57 <button name="submit" type="submit" style="margin-left:148px;margin-top: 4px;width:95px;border-radius: 3px;height: 30px">Add</button> <br>
58
59 </div> <!-- col-md-12 -->
60
61
62 </form>
63 </div>
64
65
66
67
68 </div>
69
70
71
72 <!-- validation and insertion -->
73
74
75 <?php
76 include('../config.php');
77 if(isset($_POST['submit'])){
78
79
80 $sql = "INSERT INTO doctor (doctor_id,name,address,contact,email,expertise,id,fee)
81 VALUES ('" . $_POST["doctor_id"] ."','" . $_POST["name"] . "','" . $_POST["address"] . "','" . $_POST["contact"] . "','" . $_POST["email"] . "', '" . $_POST["expertise"] . "','" . $_POST["id"] . "','" . $_POST["fee"] . "' )";
82
83 if ($conn->query($sql) === TRUE) {
84 echo "<script>alert('New Doctor Has been Added Successfully!');</script>";
85 } else {
86 echo "<script>alert('There was an Error')<script>";
87 }
88
89 $conn->close();
90 }
91 ?>
92
93
94
95 <!-- validation and insertion End-->
96
97
98
99 <?php include('footer.php'); ?>
100
101
102
103 </div><!-- containerFluid Ends -->
104
105
106
107
108 <script src="js/bootstrap.min.js"></script>
109
110
111
112
113
114
115 </body>
116 </html>